<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
   
</style>
<body>
    <div class="main">
        <button onclick="test()">点击</button>
    </div>
</body>


<script>
    function test(){
        console.log(111111)
        var features = "height=500, width=800, top=20%, left=20%, toolbar=no, menubar=no,scrollbars=no,resizable=no, location=no, status=no";
        var myWindow = window.open("","",features);
        var htm = "<form></form>";
        myWindow.document.write(htm);

        console.log(myWindow.document.body)
        myWindow.close() 
    }
   


</script>
</html>